<template>
    <div class="uncle">
        <h2>叔叔元素(uncle))</h2>
        <h3>从getters中调用</h3>
        <h3>{{$store.getters.afterData}}</h3>
        <h3>从computer中调用</h3>
        <h3>{{uncleData * 2}}</h3>
        <Button type="primary" @click="moUpdata()">修改引入模块值</Button>
    </div>
</template>

<script>
import { mapGetters } from 'vuex'
import mo from './module'

export default {
    name: "uncle",
    props: ['fun'],
    computed: {
        ...mapGetters({
            uncleData: 'afterData'
        })
    },
    mounted() {
        console.log(this.fun(123));
    },
    methods: {
        moUpdata() {
            alert(mo.abc)
        }
    }
};
</script>

<style lang="less">
.uncle {
    width: 300px;
    height: 300px;
    border: 3px solid DarkOrange;
}
</style>
